Do not capture stderr when reading heroku config.

Akinori MUSHA 10 years ago
parent
commit
4ea8752b91
1 changed files with 6 additions and 2 deletions
  1. 6 2
      bin/setup_heroku

+ 6 - 2
bin/setup_heroku

@@ -10,7 +10,11 @@ unless `which heroku` =~ /heroku/
10 10
 end
11 11
 
12 12
 def capture(cmd, opts = {})
13
-  o, s = Open3.capture2e(cmd, opts)
13
+  if opts.delete(:no_stderr)
14
+    o, s = Open3.capture2(cmd, opts)
15
+  else
16
+    o, s = Open3.capture2e(cmd, opts)
17
+  end
14 18
   o.strip
15 19
 end
16 20
 
@@ -33,7 +37,7 @@ def yes?(question)
33 37
 end
34 38
 
35 39
 def grab_heroku_config!
36
-  config_data = capture("heroku config -s")
40
+  config_data = capture("heroku config -s", no_stderr: true)
37 41
   $config = {}
38 42
   if config_data !~ /has no config vars/
39 43
     config_data.split("\n").map do |line|